package web_pro;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;

public class xcx_login {
	String log="";
    String pwd="";
    String admin_name="";
    boolean xcx_login_login(String Vlog,String Vpwd){
 	   boolean loginok=false;
 	   Connection  conn = (Connection) pub_fun.getConnection();
    	String Sql_str = "select * from xcx_login where log='"+Vlog+"' and pwd='"+Vpwd+"'" ;
    	String Ostr="";
    	boolean Oboolean=false;
    	try {
			PreparedStatement pstat = (PreparedStatement) conn.prepareStatement(Sql_str);
			ResultSet rs = (ResultSet) pstat.executeQuery();
			while(rs.next())  
	            {  
 				     loginok=true;
				}  
	        pstat.close();
	        conn.close();

 
        } catch (SQLException e) {
            e.printStackTrace();
        }
    	System.out.println(loginok);
		
 	   return loginok;
    }
}
